import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooOperateLogController } from '../../../controllers';
const uctoooperateLogRouter = new Router();
const operateLogController = new uctooOperateLogController();

uctoooperateLogRouter.post('/add', requireUser, operateLogController.add);
uctoooperateLogRouter.post('/edit', requireUser, rowLevelPermission('uctoo/operate_log'), operateLogController.edit);
uctoooperateLogRouter.post('/del', requireUser, rowLevelPermission('uctoo/operate_log'), operateLogController.delete);

//For getting operateLog with permission control
uctoooperateLogRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/operate_log'), operateLogController.getSingle);
uctoooperateLogRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/operate_log'), operateLogController.getMany);
uctoooperateLogRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/operate_log'), operateLogController.getMany);

//#endregion AutoCreateCode
export default uctoooperateLogRouter;
